<?php
class mod_theme extends core_modbase {
	public function __construct()
	{
		core_signal::SetHandle('display', array($this, 'display'));
	}
	
	static public function UrlCatcher($url)
	{
		return preg_match('`^(|.*/)doc.xml$`', $url) == 1;
	}
	
	public function start($url)
	{
		if (!self::UrlCatcher($url))
			throw new Error404();
		header('Content-Type: text/xml');
		echo '<url>
	<url1>
		<slogan1>CMS de Bontiv</slogan1>
		<yoururl>http://remi.bonnetchangai.free.fr</yoururl>
		<slogan12>Parce que j\'adore bidouiller des CMS</slogan12>
		<slogan2>Multi Authentification !</slogan2>
		<slogan22>SQL, facebook, twitter, oAuth, openID, LDAP, Active Directory et bien d\'autres</slogan22>
		<slogan3>Le plus abordable</slogan3>
		<slogan32>Programmation simple, et extentions simple à installer</slogan32>
	</url1>
</url>';
	}
	
	public function display($template)
	{
		$user = new user();
		$template->assign('isRegistred', $user->isRegistred() ? 1 : 0);
	}
}